<% layout('/layouts/default.html', {title: '我的地址列表', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('我的提现列表')}
			</div>
			
		</div>
		<div class="box-body">
				<#form:form id="searchForm" model="${ztWithdraw}" action="${ctx}/ztWithdraw/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
					<#form:hidden path="ztAdmin.id"/>
				</#form:form>

			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>


// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	
	columnModel: [     
		
		{header:'${text('小程序用户')}', name:'ztAdmin.name',index:'z.name',  width:170, align:"center"},
		
		
		{header:'${text('提现金额')}', name:'amount', index:'a.amount', width:70, align:"center"},
		
		
		{header:'${text('收款码')}', name:'ztAdmin.paycode', index:'z.paycode', width:100, align:"center",frozen:true, formatter: function(val, obj, row, act){
			return '<img style="width:70px;height:70px;" src="'+val+'"></img>';
		}},
		
		{header:'${text('提现时间')}', name:'createDate', index:'a.create_date', width:80, align:"center"},
		{header:'${text('打款时间')}', name:'payDate', index:'a.pay_date', width:80, align:"center"},
		{header:'${text('是否已打款')}', name:'ispay', index:'a.ispay', width:100, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_yes_no')}, val, '${text('未打款')}', true);
		}},
		{header:'${text('操作')}', name:'ispay', width:130, sortable:false, title:false, align:"center", formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('ztWithdraw:ztWithdrawData:edit')){ %>
								
				if (row.ispay == '0'){
					actions.push('<a href="${ctx}/ztWithdraw/enable?id='+row.id+'" class="btnList" title="${text('确定打款')}" data-confirm="${text('确认已经打款该用户了吗？')}"><i class="fa fa-trash-o">确认打款</i></a>&nbsp;');							
				}
				
			return actions.join('');
		<%}%>
			}}
	
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>